SpatialStream® Code Examples

Surface Transformer

Once you have a valuable set of spatial data for your mapping application, the question becomes – how do you efficiently display and link it? The Surface Transformer functional component helps you format your raw data and define how and where to display it as well as which commands to display with your data. This simplifies the data display process and structures it so updates are easy and independent of application code. The Surface Transformer allows you to create a UI element that is unique to both the data display surface (i.e. balloon, details screen, mouse over tip) and the layer, or data set.

This example shows how to use the Surface Transformer functional component in conjunction with GetByGeometry to identify a neighborhood polygon and populate neighborhood information in a balloon that displays on layer click events.

Surface Transformer | GetByGeometry

//Load Surface-Transformer class
var st = Dmp.Util.SurfaceTransformer;
var res = map.getDmpLayerById("neighborhoodLayer").getChildById("neighborhoodResource");
st.transform(record, res, "Account_Folder/Transformers/Samples/Balloon_ACCOUNT_FOLDER_NEIGHBORHOODS.xml", function(html) {

//Use standard Bing Map API to add a balloon surface
veShape.SetDescription(html);
veShape.HideIcon();
veShapeLayer.AddShape(veShape);
map.ShowInfoBox(veShape);

});


Run Sample   View Video   Back To Index